<?php


$tel = $_REQUEST['tel'];
$password = $_REQUEST['password'];
$repass = $_REQUEST['repass'];

include('./conn.php');


$selectUName = "select * from registry_login where tel='$tel' and password = '$password' and repass = '$repass'";

$res = $conn->query($selectUName);

// if($res->num_rows>0){
//   echo '<script>alert("注册失败,手机号已存在");</script>';
//   echo '<script>location.href="../src/register.html";</script>';
//   die();
// }

// 插入数据
$insertUser = "insert into registry_login (tel,password,repass) values ('$tel','$password','$repass')";

$inserted = $conn->query($insertUser);

if($inserted){
  echo '<script>alert("注册成功");</script>';
  echo '<script>location.href="../src/Login.html";</script>';
}


?>